/*
May 8, 2013
Assets.java
Erich Hauck
 */

import javax.swing.*;
import java.awt.*;
public class Assets extends JPanel
{
   private ImageIcon imageArray[];
   int hp=3;
   int currentHeart=3;
   Image heart;
   Image gameOver;
   public int levelDown, monstersKilled;
   
   Assets()
   {    
      imageArray = new ImageIcon[5];
      //Adds heart images
      imageArray[0] =  new ImageIcon("HP0.png");
      imageArray[1] =  new ImageIcon("HP1.png");
      imageArray[2] =  new ImageIcon("HP2.png");
      imageArray[3] =  new ImageIcon("HP3.png");
      
      //game over image
      imageArray[4] =  new ImageIcon("game-over.png");
      hp=3;
      heart= imageArray[currentHeart].getImage();
      gameOver = imageArray[4].getImage();
   }
   //takes damage
   public void hurt()
   {
      hp--;
      currentHeart--;
   }
   public void kill()
   {
      hp=0;
      currentHeart=0;
   }
   
   public void setImage()
   {
      heart= imageArray[currentHeart].getImage();
   }
   public Image getImage()
   {
      if(hp>0)
      return heart;
      
      else 
      {
         return gameOver;
      }
   }
   
   public int getHP()
   {
      return hp;
   }
   
   public void setHP(int HP, int heart)
   {
	   hp=HP;
	   currentHeart=heart;
   }
}
 